package com.celesea.auth.position.entity;

import com.celesea.auth.position.vo.PositionVo;
import com.celesea.framework.entity.BaseEntity;
import com.celesea.framework.util.EnvUtil;
import com.celesea.framework.vo.DictionaryVo;

import javax.persistence.Column;
import javax.persistence.Table;

@Table(name = "position_user_mapping")
public class PositionUser extends BaseEntity {

    @Column(name = "`user_id`", columnDefinition = "用户Id")
    private String userId;
    @Column(name = "`user_name`", columnDefinition = "用户名称")
    private String userName;
    @Column(name = "`position_id`", columnDefinition = "岗位Id")
    private String positionId;
    @Column(name = "`position_name`", columnDefinition = "岗位名称")
    private String positionName;
    @Column(name = "`dept_id`", columnDefinition = "所属部门")
    private String deptId;
    @Column(name = "`dept_name`", columnDefinition = "所属部门名称")
    private String deptName;
    @Column(name = "`extend`", columnDefinition = "是否继承到下级:[0：否，1：是]", nullable = false)
    protected Byte extend;

    public PositionUser() {
        super();
    }

    public PositionUser(PositionVo entity, DictionaryVo item) {
        super.tenantId= EnvUtil.getTenantId();
        this.userId = item.getId();
        this.userName = item.getName();
        this.positionId = entity.getId();
        this.positionName = entity.getName();
    }

    public String getPositionId() {
        return positionId;
    }

    public void setPositionId(String positionId) {
        this.positionId = positionId;
    }

    public String getPositionName() {
        return positionName;
    }

    public void setPositionName(String positionName) {
        this.positionName = positionName;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public Byte getExtend() {
        return extend;
    }

    public void setExtend(Byte extend) {
        this.extend = extend;
    }
}
